package com.mayikt.days005;

import java.util.concurrent.locks.LockSupport;

/**
 * @ClassName Test003
 * @Author 蚂蚁课堂余胜军 QQ644064779 www.mayikt.com
 * @Version V1.0
 **/
public class Test003 {
    public static void main(String[] args) {
        Thread t1 = new Thread(() -> {
            System.out.println("让我们子线程变为阻塞等待");
            // 让当前线程变为阻塞。
            LockSupport.park();
            System.out.println("唤醒我们的子线程");
        });
        t1.start();
        try {
            Thread.sleep(3000);
        } catch (Exception e) {

        }
        // 唤醒我们阻塞的线程
        LockSupport.unpark(t1);
    }
}
